#include <iostream>

using namespace std;

int N;
char ch[11];

int main()
{
	int i = 0;
	int k = 0;
	cin >> N;
	while (N)
	{
		if (k % 3 == 0 && k!=0)
			ch[i++] = ',';
		ch[i++] = N % 10+ '0';
		N = N / 10;
		k++;
	}
	for (k = i - 1; k >= 0; k--)
		cout << ch[k];
	return 0;
}